using System;
using System.Collections.Generic;
using System.Text;
using OR.Lazarus.Business;

using SourceModel = OR.Lazarus.Library.DataTier.Source;
using CompiledModel = OR.Lazarus.Library.DataTier.Compiled;

namespace OR.Lazarus.Library.DataTier
{
	public class SourceGenerator : CodeGenerator<CompiledModel.ProjectDetail>
	{
		protected override void OnAfterGenerateCompiled( EventArgs e )
		{
			base.OnAfterGenerateCompiled( e );
			mManifest.DataSource.User = mCompiled.DataSource.User;
			mManifest.DataSource.Password = mCompiled.DataSource.Password;
			mManifest.DataSource.Schema = mCompiled.DataSource.Schema;
			mManifest.DataSource.Location = mCompiled.DataSource.Location;
		}

		protected override void OnInitializeManifest()
		{
			base.OnInitializeManifest();

			mManifest.DataSource.Name = mCompiled.DataSource.Name;
			mManifest.DataSource.Location = mCompiled.DataSource.Location;
			mManifest.DataSource.Schema = mCompiled.DataSource.Schema;
			mManifest.DataSource.User = mCompiled.DataSource.User;
			mManifest.DataSource.Password = mCompiled.DataSource.Password;
		}
	}
}
